/**
* @file module_activity.h
* @brief 活动模块
*/
#ifndef MODULE_ACTIVITY_H_
#define MODULE_ACTIVITY_H_

#include "../share/common_singleton.h"
#include "../share/proxyclient_service.h"

class Player;

typedef std::vector< int32_t > TActivityIDList;

class CActivityModule :
	public ::common::CSingleton< CActivityModule >
{
 public:
	 CActivityModule( ):update_time_(0) { }
	~CActivityModule( ) { }

	bool Init( );

	bool Finalize( );

	void TickUpdate( );

    bool IsActivityOpen( int32_t activity_id );

	// 启动后，活动是否被计算过了;
	bool Calculated() const { return update_time_ != 0;}

    int32_t GetNextFireTime( int32_t activity_id );


	static void OnMsgPlayerActivityInfoRequest(Player& player, const CJsonMessageBase& msg);
private:
	TActivityIDList opened_activity_list_;
	time_t update_time_;
};


#endif
